﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CodeDetailList.ascx.cs"
    Inherits="Admin_Components_Ajax_CodeDetailList" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:ScriptManager ID="ScriptManager2" runat="server">
</asp:ScriptManager>

<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Sunset" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" />
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function showForm(url) {
            window.radopen(url, "RadWindow1");
            return false;
        }
        function OnClientClose(oWnd, args, code, name) {
            var arg = args.get_argument();
            if (arg == '' || arg == null) {
            }
            else {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(arg);
            }
        }
    </script>
</telerik:RadCodeBlock>
<asp:UpdatePanel ID="u" runat="server">
    <ContentTemplate>
<telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false" runat="server"
    Skin="Sunset" EnableShadow="true" DestroyOnClose="True" EnableAriaSupport="True">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="CodeDetailList.aspx" OnClientClose="OnClientClose">
        </telerik:RadWindow>
    </Windows>
    <Windows>
        <telerik:RadWindow ID="RadWindow2" runat="server" Height="500px" OnClientClose="OnClientClose"
            Width="700px">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
        <div>
    
    <div class="form-horizontal col-md-6 wrapper-center">
        
            <div class="form-group">
                
                <label class="col-md-4 control-label">
                        Loại danh mục</label>
                <div class="col-md-8">
                    <div class="combobox_long">
                        <telerik:RadComboBox ID="cboCMCODE" runat="server" TabIndex="1" CssClass="col-imp-8"
                            onselectedindexchanged="cboCMCODE_SelectedIndexChanged" />
                    </div>
                </div>
            </div>
            <div class="set-btns text-center">
               
                    <div class="progressbar">
                        <asp:UpdateProgress ID="up" runat="server" AssociatedUpdatePanelID="u">
                            <ProgressTemplate>
                                <img src="Template/Images/ajax-progress-bar.gif"/>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                 
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Tìm" 
                        class="btn btn-sm btn-primary" TabIndex="2" />
                    <asp:Button ID="btnClear" runat="server" OnClick="btnClear_Click" Text="Nhập lại"
                        class="btn btn-sm btn-primary" TabIndex="3" />
                    <asp:Button ID="btnNew" runat="server" Text="Thêm mới" class="btn btn-sm btn-primary" 
                        OnClick="btnNew_Click" TabIndex="4" />
                
                    
                </div>
            </div>
        
    </div>
   <div style="text-align:right;padding:0 35px">
        <asp:Button ID="btnDelSelection" CssClass="button_radgrid" runat="server" OnClientClick="return ConfirmOnDelete('Bạn chắc muốn xóa những danh mục đã chọn ?');"
                         OnClick="btnDelSelection_Click" />   
 </div>
    <div class="row">
        <telerik:RadGrid ID="grvData" runat="server" CellSpacing="0" GridLines="None" AutoGenerateColumns="False"
            HeaderStyle-HorizontalAlign="Center" OnItemCommand="grvData_ItemCommand" 
            AllowMultiRowSelection="True" PageSize="50" CssClass=" table table-bordered"
            onpageindexchanged="grvData_PageIndexChanged" 
            onpagesizechanged="grvData_PageSizeChanged">
            <MasterTableView ShowHeader="true" AllowPaging="True" PageSize="20" NoMasterRecordsText="Không có dữ liệu."
                ShowGroupFooter="true">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="STT" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%# Container.ItemIndex + 1 %></ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn SortExpression="CMCode" HeaderText="Loại danh mục" HeaderButtonType="TextButton"
                        DataField="CMCode" UniqueName="CMCode" ItemStyle-HorizontalAlign="Center">
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="CDCode" HeaderText="Mã danh mục" HeaderButtonType="TextButton"
                        DataField="CDCode" UniqueName="CDCode" ItemStyle-HorizontalAlign="Center">
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="CDName" HeaderText="Tên danh mục" HeaderButtonType="TextButton"
                        DataField="CDName" UniqueName="CDName" >
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="NumberValue" HeaderText="Giá trị số" HeaderButtonType="TextButton"
                        DataField="NumberValue" UniqueName="NumberValue" ItemStyle-HorizontalAlign="Center">
                        <HeaderStyle HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="DateTimeValue" HeaderText="Giá trị ngày"
                        HeaderButtonType="TextButton" DataField="DateTimeValue" UniqueName="DateTimeValue"
                        ItemStyle-HorizontalAlign="Center">
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="StandardName" HeaderText="Tên chuẩn" HeaderButtonType="TextButton"
                        DataField="StandardName" UniqueName="StandardName">
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Ordinal" HeaderText="Thứ tự" HeaderButtonType="TextButton"
                        DataField="Ordinal" UniqueName="Ordinal" ItemStyle-HorizontalAlign="Center">
                        <HeaderStyle HorizontalAlign="Right" />
                        <ItemStyle HorizontalAlign="Right"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Remark" HeaderText="Ghi chú" HeaderButtonType="TextButton"
                        DataField="Remark" UniqueName="Remark" >
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Status" HeaderText="Trạng thái" HeaderButtonType="TextButton"
                        DataField="Status" UniqueName="Status" ItemStyle-HorizontalAlign="Center">
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Chi tiết" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:Button ID="lnkView" CssClass="btnViewDetail" CommandArgument='<%# Eval("CDCode") %>'
                                CommandName="ViewItem" runat="server"></asp:Button>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Sửa" HeaderButtonType="TextButton" 
                        ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:Button ID="lnkEditDel" CssClass="btnDelete" CommandArgument='<%# Eval("CDCode") %>'
                                CommandName="EditDelItem" runat="server"></asp:Button>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </telerik:GridTemplateColumn>
                    <telerik:GridClientSelectColumn FilterControlAltText="Filter checkbox column" UniqueName="checkbox">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridClientSelectColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid>
    </div>
</div>
    </ContentTemplate>
</asp:UpdatePanel>
    
    
